package com.du.handler;

import com.du.exception.SsmException;
import com.du.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 异常处理器
 */
@ControllerAdvice
public class SsmExceptionHandler {
    @ExceptionHandler({SsmException.class})
    @ResponseBody
    public ResultVO ssmException(SsmException e){
        return new ResultVO(e.getCode(),e.getMessage(),null);
    }
}
